package com.example.administrator.dc.fragment;


import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.TextView;

import com.example.administrator.dc.R;
import com.example.administrator.dc.Bean.School;
import com.example.administrator.dc.dialog.coustomDialog;
import com.example.administrator.dc.model.UsersModel;

import java.util.List;

import retrofit2.Call;
import retrofit2.Callback;

/**
 * A simple {@link Fragment} subclass.
 */
public class StoreFragment extends Fragment {
  private   WebView webView;
   private Context context;
    private coustomDialog  coustomDialog;
    private  View view;


    public void onViewCreated(View view,@Nullable Bundle savedInstanceState) {
        coustomDialog coustomDialog=new coustomDialog(getActivity(),200,100,R.layout.coustomdialog,R.drawable.camera);
        coustomDialog.getDensity(getActivity());
       webView= (WebView) view.findViewById(R.id.webview_article);
        WebSettings settings=webView.getSettings();
        settings.setJavaScriptEnabled(true);
        settings.setUseWideViewPort(true);
        settings.setLoadWithOverviewMode(true);
        settings.setBuiltInZoomControls(true);
        settings.setSupportZoom(true);
        webView.loadUrl("https://weidian.com/?userid=783799861");
        webView.setWebViewClient(new WebViewClient(){
      @Override
       public boolean shouldOverrideUrlLoading(WebView view, String url) {
       // TODO Auto-generated method stub
       //返回值是true的时候控制去WebView打开，为false调用系统浏览器或第三方浏览器
       view.loadUrl(url);
       return true;
      }
     });



    };

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        return inflater.inflate(R.layout.fragment_store, container, false);

    }


}
